package com.prestamomo.vil.ppa.pmvilpage;

import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import android.widget.TextView;

import com.prestamomo.vil.ppa.R;
import com.prestamomo.vil.ppa.pmvilmedium.pmviluse.PmvilSpMd;
import com.prestamomo.vil.ppa.pmvilmedium.pmvilarm.PmvilCellReverMd;
import com.prestamomo.vil.ppa.pmvilpage.pmrot.PmvilAtyRoot;

public class PmvilRollVy extends PmvilAtyRoot {

    private TextView rollPmLyTvdegl;

    @Override
    protected int getPmvilLayoutId() {
        return R.layout.roll_pmvil_ly;
    }

    @Override
    protected void showPmvilUi() {
        PmvilCellReverMd pmvilCellRecverMd = new PmvilCellReverMd();
        IntentFilter intentPmvilFilter = new IntentFilter();
        intentPmvilFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
        registerReceiver(pmvilCellRecverMd,intentPmvilFilter);
        rollPmLyTvdegl = findViewById(R.id.roll_pm_ly_tvdegl);
    }

    @Override
    protected void clickePmvil() {
        rollPmLyTvdegl.setOnClickListener(v -> {
            String pmvilUseridPm = (String) PmvilSpMd.getPmvaParam(this, "pmvil_userId_pm", "");
            String pmvilUuIdPm = (String) PmvilSpMd.getPmvaParam(this, "pmvil_uuId_pm", "");
            if(!TextUtils.isEmpty(pmvilUseridPm)&&!TextUtils.isEmpty(pmvilUuIdPm)){
                startActivity(new Intent(PmvilRollVy.this, PmvilOwnerVy.class));
                finish();
            }else{
                startActivity(new Intent(PmvilRollVy.this, PmvilLoginVy.class));
                finish();
            }
        });
    }

    @Override
    protected void loadPmvilData() {


    }
}
